package com.ghh.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.ghh.entity.Result;
import com.ghh.service.OrderSettingService;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

@RestController
@RequestMapping("/orderSetting")
public class OrderSettingController {

    @Reference
    private OrderSettingService orderSettingService;

    @RequestMapping("/findByOrderDate")
    public Result findByOrderDate(@DateTimeFormat (pattern="yyyy-MM-dd") Date orderDate){
        Double percentage = orderSettingService.findByOrderDate(orderDate);
        return new Result(true,percentage);
    }
}
